package com.sgcc.pms.getway.handler;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.server.WebFilterExchange;
import org.springframework.security.web.server.authentication.ServerAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;

import com.sgcc.pms.getway.utils.WriteResponse;
import com.sgcc.pms.tocs.common.result.WrapperedResult;

import reactor.core.publisher.Mono;

@Component
public class JsonServerAuthenticationSuccessHandler implements ServerAuthenticationSuccessHandler {

	@Override
	public Mono<Void> onAuthenticationSuccess(WebFilterExchange webFilterExchange, Authentication authentication) {
		// 登录成功后可以放入一些参数到session中
		return WriteResponse.write(webFilterExchange, WrapperedResult.ok("登录成功！"));
	}

}
